<?php

/******************************************************************************
 *
 *	PROJECT: Flynax Classifieds Software
 *	VERSION: 4.0
 *	LISENSE: FL87MPRYOA0R - http://www.flynax.com/license-agreement.html
 *	PRODUCT: Auto Classifieds
 *	DOMAIN: www.siyaradiali.com
 *	FILE: RLRECAPTCHA.CLASS.PHP
 *
 *	This script is a commercial software and any kind of using it must be 
 *	coordinate with Flynax Owners Team and be agree to Flynax License Agreement
 *
 *	This block may not be removed from this file or any other files with out 
 *	permission of Flynax respective owners.
 *
 *	Copyrights Flynax Classifieds Software | 2012
 *	http://www.flynax.com/
 *
 ******************************************************************************/

class rlReCaptcha extends reefless
{
	/**
	* class constructor
	**/
	function rlReCaptcha($mode = false)
	{
		$this -> clearCompile($mode);
	}
	
	/**
	*
	* clear compile directory
	*
	**/
	function clearCompile($mode = false)
	{
		global $config;
		
		if ( $mode )
		{
			$compile = $this -> scanDir(RL_TMP .'compile');
			foreach ($compile as $file)
			{
				unlink(RL_TMP .'compile'. RL_DS . $file);
			}
		}
		else
		{
			$group_id = $this -> getOne('ID', "`Key` = 'reCaptcha'", 'config_groups');
			if ( $_POST['group_id'] == $group_id && !$config['reCaptcha_module'] && $_POST['config']['reCaptcha_module']['value'] )
			{
				$compile = $this -> scanDir(RL_TMP .'compile');
				foreach ($compile as $file)
				{
					unlink(RL_TMP .'compile'. RL_DS . $file);
				}
			}
		}
	}
}